<!DOCTYPE html>
<html lang="en">

	<head>
		<base href="../../../../Techshine-vw/" />
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>留言列表</title>
		<style>
			.select2-container {
				width: auto;
			}
		</style>
	</head>
	<body>

		<div id="page-wrapper" style="margin: 0px; min-height: 145px;">
		
			<form class="form-inline" id="userForm">
				<div class="row" style="border-bottom: 1px solid #eee;">
					<div class="col-lg-6 col-md-6 col-xs-6">
						<h1 class="page-header" style="border-bottom: none">留言列表</h1>
					</div>
					<div class="col-lg-6 col-md-6 col-xs-6" style="margin-top: 42px;">
						<div class="form-group">
							<input type="text" class="form-control" id="name" name="name" style="width: 200px;" placeholder="姓名/学号/部门">
							<button type="button" id="searchBar_btn" class="btn btn-success">查询</button>
							<button type="button" id="reset_btn" class="btn btn-success">重置</button>
							<button type="button" id="add" class="btn btn-info">添加</button>
							<button type="button" id="importExcel" class="btn btn-primary">导入</button>
							<button type="button" id="exportExcel" class="btn btn-primary">导出</button>
						</div>
					</div>
					
				</div>
			</form>	
			
			<div class="row" style="margin-top: 50px;">
				<div class="col-md-12 col-sm-12 col-xs-12" style="height: 100%;">
					<div id="zzg_table"></div>
				</div>
			</div>
		</div>
<script src="Main/js/jQuery/jquery.loadData.js"></script>
<script>
	$(function() {
		$("#zzg_table").zPage({
			url: 'msg/queryListByPage',
			columns: [
					{field: 'id',title: ''}, 
					{field: 'name',title: ''}, 
					{field: 'code',title: ''}, 
					{field: 'createtime',title: ''}, 
					{field: 'comm',title: '公司'}, 
					{field: 'phone',title: ''}, 
					{field: 'email',title: ''}, 
					{field: 'cont',title: '内容'}, 
				{title: '操作',formatter: function(value, row, index) {
					return '<button type="button" onclick="openEdit(\'' + row.id + '\');" class="btn btn-success update">编辑</button>' +
						'<button  type="button" deleteId=' + row.id + ' class="btn btn-danger delete">删除</button>' ;
				}
			}],
			beforeSend: function() {},
			complete: function() {}
		});
		/*
		 * 添加用户
		 */
		$("#add").click(function() {
			initOpen({
				type: 2,
				title: '新增留言',
				content: 'html/msg/addMsg.html'
			});
		});

	});

	$("#importExcel").click(function() {
		initOpen({
			type: 2,
			title: '导入留言',
			content: 'html/msg/importMsg.html'
		});
	});

	/*
	 * 导出到excel
	 */
	$("#exportExcel").click(function() {

		window.location.href = "msg/exportExcel";

	});

	function openEdit(id) {
		initOpen({
			type: 2,
			title: '编辑留言',
			content: 'html/msg/editMsg.html?id=' + id
		});
	}
	function resetWard() {
		$('#password').val('');
		$('#password1').val('');
	}
</script>
	</body>

</html>